package com.hfkh.loop;

import java.util.Scanner;

public class WhileDemo2 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("学习任务完成了吗?(y/n)");
        String answer = input.next();
        while(! "y".equalsIgnoreCase(answer)){
            System.out.println("1.上午阅读教材，掌握理论部分.");
            System.out.println("2.下午上机实操，掌握代码部分.");
            System.out.print("学习任务完成了吗?(y/n)");
            answer = input.next();
        }
        System.out.println("恭喜你，学习任务完成了！");
    }
}
